﻿@model Leads360Express.Repository.Pages.User.UserModel

@{
    ViewBag.Title = "Edit User";
    Layout = "~/Views/Shared/_Layout..cshtml";
}

<form action="#" class="form" id="agent" >      

  <fieldset >
        <div class="content">
            <h2 class="app">
				<strong>Edit User</strong>
			    @Html.Partial("_PatialLeads_Calls", @Model.LeadCall )
			</h2>
            <div class="error-msg hidden" id="errormsg" style="display:none; margin-top:-1px" data-bind="visible: visibleErrormsg">
			     <span class="error" data-bind="text: msgError "></span>
	        </div>
            <div class="info-msg" id="sucessmsg" style="display:none; margin-top:-1px" data-bind="visible: visiblemsg">
			     <span class="error" data-bind="text: msgError "></span>
	        </div>
            <div class="title nomargin">
				<h3>User Settings</h3>
		    </div>
            <div class="panel rounded">
                <ul class="accordeon-tabs accordeon-2">
                    <li class="open">
                        <span class="panel">
                            <div class="row">
                              <label for="text" style="width:175px;">First Name:</label>
                              <input class="text" style="width:190px;" type="text" name="FirstName" id="FirstName" data-bind="value: FirstName, attr: {maxlength: 20}" />
                            </div>
                            <div class="row">
                              <label for="text" style="width:175px;">Last Name:</label>
                              <input class="text" style="width:190px;" type="text" name="LastName" id="LastName" data-bind="value: LastName, attr: {maxlength: 30}" />
                            </div>  
                            <div class="row" id="rowEmail">
                              <label for="text" style="width:175px;">Email:</label>
                                @if (Model.Header.IsAdmin)
                                {
                                    <input class="text" style="width:190px;" type="text" name="Email" id="Email" data-bind="value: Email, attr: {maxlength: 100}" />
                                }
                                else
                                {
                                    <input class="text" style="width:190px;" type="text readonly" name="Email" id="Email" readonly="readonly" data-bind="value: Email, attr: {maxlength: 100}" />
                                }
                            </div> 
                       
                            <div class="row rowworkphone" >
                            <label for="text" style="width:175px;">Work Phone:</label>
                          
                            <span class="phone_fields_wrapper groupinput">
                                <input type="hidden" class="hidden" id="WorkPhone" name="WorkPhone" data-bind="value: WorkPhone" />
                                <div class="input-holder-setup" style="width:210px;">
                                    <input id="cell1" class="text phone-field phone-area"  type="text" data-bind="value: CellPhone1, attr:{maxlength:3}" />
                                    <span class="phone-sep">–</span>
                                    <input id="cell2" class="text phone-1" type="text" data-bind="value: CellPhone2, attr:{maxlength:3}" />
                                    <span class="phone-sep">–</span>
                                    <input id="cell3" class="text phone-2" type="text" data-bind="value: CellPhone3, attr:{maxlength:4}" />

                                    <input id="WorkPhoneExt" name="WorkPhoneExt" class="text phone-ext" type="text" data-bind="value: WorkPhoneExt, attr:{maxlength:8}" />
                                </div>
                            </span>
						    </div>
                        </span>
                    </li>
                </ul>
            </div> 
            <div >
                <div class="title nomargin">
			        <h3>Password Information</h3>
		        </div>
                <div class="panel grouped-form rounded">
                    <ul class="accordeon-tabs accordeon-2">
                        <li class="open">
                            <span class="panel" style ="width:98%;">
                            <div class="row" id="NewPassword">
                                <label for="text" style="vertical-align: top">New Password:<br />
                                    <span style="font-weight:normal;" class="lightgray">Minimum of 6 characters, with at least 1 letter and 1 number</span>
                                </label>
                                <input class="text" type="password" name="NewPassword" id="NewPasswordvalue" data-bind="value: NewPassword, attr: {maxlength: 100}" />
                            </div>
                            <div class="row" id="ConfirmPassword">
                                <label for="text">Confirm New Password:</label>
                                <input class="text" type="password" name="ConfirmPassword" id="ConfirmPasswordvalue" data-bind="value: ConfirmPassword, attr: {maxlength: 100}" />
                            </div>      
                            </span>
                        </li>
                    </ul>                  
                </div>
            </div>

            <h3 class="centered-wbtn centered-wbtn-bottom save">
  				<span>
  				    <input type="button" class="btn btn-cancel-page" value="Previous" onclick="window.location.href='/User'">
					<input type="submit" class="btn btn-submit-page" data-bind="click: EditUser">
                </span>
			</h3>
            @Html.Partial("_Footer.Copyright")
        </div>
    </fieldset> 
</form>
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model.AgentInfoModel)));
</script>
<script src="/Scripts/viewModel/userEditViewModel.js" type="text/javascript"></script>